<!DOCTYPE html>
<html devsite>
  <head>
    <title>TensorFlowLiteSwift Framework Reference</title>
    <link rel="stylesheet" href="../../css/jazzy.css" />
    <meta charset='utf-8'>
  </head>
  <body>
    <div class="content-wrapper">
      <article class="main-content">
        <section>
          <section class="section">
            <h1>Options</h1>
              <div class="declaration">
                <div class="language">
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Options</span> <span class="p">:</span> <span class="kt">Equatable</span><span class="p">,</span> <span class="kt">Hashable</span></code></pre>

                </div>
              </div>
            <p>Options for configuring the <code><a href="../../Classes/Interpreter.html">Interpreter</a></code>.</p>

          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:19TensorFlowLiteSwift11InterpreterC7OptionsV11threadCountSiSgvp"></a>
                    <a name="//apple_ref/swift/Property/threadCount" class="dashAnchor"></a>
                    <h3><a class="token" href="#/s:19TensorFlowLiteSwift11InterpreterC7OptionsV11threadCountSiSgvp">threadCount</a></h3>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>The maximum number of CPU threads that the interpreter should run on. The default is <code>nil</code>
indicating that the <code><a href="../../Classes/Interpreter.html">Interpreter</a></code> will decide the number of threads to use.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="objc">
                          <p class="aside-title-objc">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">threadCount</span><span class="p">:</span> <span class="kt">Int</span><span class="p">?</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:19TensorFlowLiteSwift11InterpreterC7OptionsV16isXNNPackEnabledSbvp"></a>
                    <a name="//apple_ref/swift/Property/isXNNPackEnabled" class="dashAnchor"></a>
                    <h3><a class="token" href="#/s:19TensorFlowLiteSwift11InterpreterC7OptionsV16isXNNPackEnabledSbvp">isXNNPackEnabled</a></h3>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Indicates whether an optimized set of floating point CPU kernels, provided by XNNPACK, is
enabled.</p>
<div class="aside aside-experiment">
    <p class="aside-title">Experiment</p>
    <p>Enabling this flag will enable use of a new, highly optimized set of CPU kernels provided
via the XNNPACK delegate. Currently, this is restricted to a subset of floating point
operations. Eventually, we plan to enable this by default, as it can provide significant
performance benefits for many classes of floating point models. See
<a href="https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/delegates/xnnpack/README.md">https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/delegates/xnnpack/README.md</a>
for more details.</p>

</div><div class="aside aside-important">
    <p class="aside-title">Important</p>
    <p>Things to keep in mind when enabling this flag:</p>

<ul>
<li>Startup time and resize time may increase.</li>
<li>Baseline memory consumption may increase.</li>
<li>Compatibility with other delegates (e.g., GPU) has not been fully validated.</li>
<li>Quantized models will not see any benefit.</li>
</ul>

</div><div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    <p>This is an experimental interface that is subject to change.</p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="objc">
                          <p class="aside-title-objc">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">isXNNPackEnabled</span><span class="p">:</span> <span class="kt">Bool</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:19TensorFlowLiteSwift11InterpreterC7OptionsVAEycfc"></a>
                    <a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
                    <h3><a class="token" href="#/s:19TensorFlowLiteSwift11InterpreterC7OptionsVAEycfc">init()</a></h3>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Creates a new instance with the default values.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="objc">
                          <p class="aside-title-objc">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>          </section>
        </section>
      </article>
    </div>
  </body>
</html>
